<?php
/**
 * Each engineer has a duty to keep the code elegant
 * Created by wolffy.
 * Author @wolffy<13750088090@sina.cn>
 * Date: 2018/8/12
 * Time: 11:40
 */
namespace App\Repositories;

use App\Models\SmsLog;

class SmsLogRepository
{
    /**
     * 创建短信日志
     * @param array $params
     * @return mixed
     */
    public function create(array $params)
    {
        return SmsLog::create($params);
    }

    /**
     * 根据id获取短信日志资料
     * @param $id
     * @return mixed
     */
    public function ById($id)
    {
        return SmsLog::find($id);
    }

    /**
     * 根据name查询短信日志资料
     * @param $mobile
     * @return mixed
     */
    public function ByMobile($mobile)
    {
        return SmsLog::where('mobile', $mobile)->first();
    }
}